/**
 * 
 */
package br.srv.full.virtual.entities.resume;

import java.io.Serializable;

import br.srv.full.virtual.entities.auth.Role;
import br.srv.full.virtual.entities.auth.User;
import br.srv.full.virtual.entities.ids.FederalId;
import br.srv.full.virtual.entities.ids.StateId;
import br.srv.full.virtual.entities.persons.Client;
import br.srv.full.virtual.entities.persons.Worker;

/**
 * @author Delfino
 * 
 */
public class WorkerInClient implements Serializable {

	private Client client;
	private Role role;
	private User user;

	/**
	 * @param p_work
	 */
	public WorkerInClient(Worker p_work) {
		user = p_work.getUser();
		role = p_work.getRole();
		client = p_work.getClient();
	}

	/**
	 * 
	 */
	public WorkerInClient() {
		client = new Client();
		role = Role.CLIENT_WORKER;
	}

	/**
	 * @param p_user
	 */
	public WorkerInClient(User p_user) {
		this();
		user = p_user;
	}

	/**
	 * @return
	 * @see br.srv.full.virtual.entities.auth.User#getAka()
	 */
	public String getClientAka() {
		return client.getAka();
	}

	/**
	 * @return
	 * @see br.srv.full.virtual.entities.auth.User#getEmail()
	 */
	public String getClientEmail() {
		return client.getEmail();
	}

	/**
	 * @return
	 * @see br.srv.full.virtual.entities.persons.Client#getFederalId()
	 */
	public FederalId getClientFederalId() {
		return client.getFederalId();
	}

	/**
	 * @return
	 * @see br.srv.full.virtual.entities.auth.User#getReduzedId()
	 */
	public String getClientReduzedId() {
		return client.getReduzedId();
	}

	/**
	 * @return
	 * @see br.srv.full.virtual.entities.auth.User#getRegistrationId()
	 */
	public String getClientRegistrationId() {
		return client.getRegistrationId();
	}

	/**
	 * @return
	 * @see br.srv.full.virtual.entities.persons.Client#getStateId()
	 */
	public StateId getClientStateId() {
		return client.getStateId();
	}

	/**
	 * @param p_aka
	 * @see br.srv.full.virtual.entities.auth.Person#setAka(java.lang.String)
	 */
	public void setClientAka(String p_aka) {
		client.setAka(p_aka);
	}

	/**
	 * @param p_email
	 * @see br.srv.full.virtual.entities.auth.Person#setEmail(java.lang.String)
	 */
	public void setClientEmail(String p_email) {
		client.setEmail(p_email);
	}

	/**
	 * @param p_federalId
	 * @see br.srv.full.virtual.entities.persons.Client#setFederalId(br.srv.full.virtual.entities.ids.FederalId)
	 */
	public void setClientFederalId(FederalId p_federalId) {
		client.setFederalId(p_federalId);
	}

	/**
	 * @param p_name
	 * @see br.srv.full.virtual.entities.auth.Person#setName(java.lang.String)
	 */
	public void setClientName(String p_name) {
		client.setName(p_name);
	}

	/**
	 * @param p_reduzedId
	 * @see br.srv.full.virtual.entities.auth.User#setReduzedId(java.lang.String)
	 */
	public void setClientReduzedId(String p_reduzedId) {
		client.setReduzedId(p_reduzedId);
	}

	/**
	 * @param p_stateId
	 * @see br.srv.full.virtual.entities.persons.Client#setStateId(br.srv.full.virtual.entities.ids.StateId)
	 */
	public void setClientStateId(StateId p_stateId) {
		client.setStateId(p_stateId);
	}

	/**
	 * @return
	 * @see br.srv.full.virtual.entities.auth.User#getName()
	 */
	public String getClientName() {
		return client.getName();
	}

	/**
	 * @return
	 * @see Role#getDescription()
	 */
	public String getRoleDescription() {
		return role.getDescription();
	}

	/**
	 * @param p_description
	 * @see Role#setDescription(java.lang.String)
	 */
	public void setRoleDescription(String p_description) {
		role.setDescription(p_description);
	}

	/**
	 * @param p_name
	 * @see Role#setName(java.lang.String)
	 */
	public void setRoleName(String p_name) {
		role.setName(p_name);
	}

	/**
	 * @return
	 * @see Role#getName()
	 */
	public String getRoleName() {
		return role.getName();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return getRoleName() + " : " + getClientName() + " (" + getClientAka() + ")";
	}

	/**
	 * @return
	 */
	public User getUser() {
		return user;
	}

	/**
	 * @return
	 */
	public Role getRole() {
		return role;
	}

	/**
	 * @return
	 */
	public Client getClient() {
		return client;
	}

	/**
	 * @param p_client
	 */
	public void setClient(Client p_client) {
		client = p_client;
	}

	/**
	 * @param p_role
	 *            the role to set
	 */
	public void setRole(Role p_role) {
		role = p_role;
	}

	/**
	 * @param p_user
	 *            the user to set
	 */
	public void setUser(User p_user) {
		user = p_user;
	}
}
